﻿
<Window x:Class="ClientTestUI.ClientWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:ClientTestUI"
    xmlns:WozLib="clr-namespace:WozLib;assembly=WozLib"
    xmlns:WozLib-Ink="clr-namespace:WozLib.UI.Ink;assembly=WozLib"
    xmlns:WozLib_Controls="clr-namespace:WozLib.UI.Controls;assembly=WozLib"
    Title="Not Connected!!!"
    SizeToContent="WidthAndHeight"
    x:Name="_ClientWindow"
    Width="400"
        Height="300"
    >
  <!--BorderThickness="0"
    WindowStyle="None"
    WindowState="Maximized"
    ResizeMode="NoResize"-->

  <Grid>
    <Grid.Background>
      <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="AliceBlue" Offset="0"/>
        <GradientStop Color="LightBlue" Offset="1"/>
      </LinearGradientBrush>
    </Grid.Background>
      <DockPanel>
        <ToolBarTray DockPanel.Dock="Top" x:Name="_ToolBarTray" > <!--Opacity="0.0"-->
          <ToolBar>
            <Button Click="Save_Click">Save</Button>
            <Button Click="Load_Click">Load</Button>
            <Button Command="ApplicationCommands.Close">Exit</Button>
          </ToolBar>
          <ToolBar>
            <CheckBox x:Name="_FullScreenCheck">FullScreen</CheckBox>
          </ToolBar>
          <ToolBar>
            <TextBox x:Name="_ServerAddrTextBox" 
                     Text="{Binding ElementName=_ClientWindow, Path=ServerAddrString, Mode=TwoWay}"
                     MinWidth="150"
                     PreviewMouseDown="_TextBox_SelectAll_PreviewMouseDown"
                     GotFocus="_TextBox_SelectAll_GotFocus"
                     />
            <Button x:Name="_ConnectButton" Click="Connect_Click">Connect</Button>
          </ToolBar>
          <ToolBar>
            <TextBlock>(press any F-Key to collapse/uncollapse this toolbar)</TextBlock>
            <Button Click="Hide_Click">Hide ToolBar</Button>
          </ToolBar>
          <ToolBar>
            <Button Click="Ink_Click">Ink</Button>
            <Button Click="Gesture_Click">Gesture</Button>
            <Button Click="InkGesture_Click">Ink &amp; Gesture</Button>
            <Button Click="Erase_Click">Erase</Button>
            <Button Click="Select_Click">Select</Button>
            <Button Click="None_Click">None</Button>
          </ToolBar>
          <!--the animations below can be used to make it so the top bar is only visible when the mouse is over it
          this turns out to be very confusing, even for me, and so we just use the F-keys to control visibility-->
          <!--<ToolBarTray.Triggers>
            <EventTrigger RoutedEvent="ToolBarTray.MouseEnter">
              <EventTrigger.Actions>
                <BeginStoryboard>
                  <Storyboard>
                    <DoubleAnimation 
                      Storyboard.TargetName="_ToolBarTray"
                      Storyboard.TargetProperty="Opacity"
                      To="1" Duration="0:0:0.1"/>
                  </Storyboard>
                </BeginStoryboard>
              </EventTrigger.Actions>
            </EventTrigger>
            <EventTrigger RoutedEvent="ToolBarTray.MouseLeave">
              <EventTrigger.Actions>
                <BeginStoryboard>
                  <Storyboard>
                    <DoubleAnimation 
                      Storyboard.TargetName="_ToolBarTray"
                      Storyboard.TargetProperty="Opacity"
                      AccelerationRatio="0.2"
                      DecelerationRatio="0.4"
                      To="0.0" Duration="0:0:0.3"/>
                  </Storyboard>
                </BeginStoryboard>
              </EventTrigger.Actions>
            </EventTrigger>
          </ToolBarTray.Triggers>-->
        </ToolBarTray>

        <Grid>
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
          </Grid.ColumnDefinitions>

          <ToolBarTray Grid.Column="0" MinWidth="70" Orientation="Vertical" Background="Transparent" Margin="2 5 2 0">
            <WozLib_Controls:ToolSelectToolbar x:Name="_ToolSelectToolbar"/>
          </ToolBarTray>

          <Canvas x:Name="_InkOverlayCanvas" Grid.Column="1" Width="{Binding ElementName=_ClientInkCanvas, Path=Width}" Height="{Binding ElementName=_ClientInkCanvas, Path=Height}">
            <!--<Canvas x:Name="_NoEditCanvas" Background="Transparent">
            <Button Canvas.Left="250" Canvas.Top="275">click me 2</Button>
          </Canvas>-->
            <WozLib-Ink:ClientInkCanvas x:Name="_ClientInkCanvas" Canvas.Left="0.0" Canvas.Top="0.0"  Width="1000" Height="1000" >
              <!--<Button Canvas.Left="50" Canvas.Top="75">click me</Button>-->
            </WozLib-Ink:ClientInkCanvas>

            <!--<Button Canvas.Left="250" Canvas.Top="275">click me 2</Button>-->

          </Canvas>
        </Grid>
      </DockPanel>
    </Grid>
</Window>
